package com.hou;

import java.util.ArrayList;
public class EpsilonTest {
    public static void main(String[] args) {
        var objects = new ArrayList<Garbage>();
        var count=0;
        while(true){
            objects.add(new Garbage());
            count++;
            if(count==500){
                objects.clear();//产生500个垃圾
            }
        }
    }
}
class Garbage{
    private String name;
    private String location;
    @Override
    protected void finalize() throws Throwable {
        System.out.println("对象回收:"+this);
    }
}
